# Maintainer: Orhun Parmaksız <orhun@archlinux.org>
# Contributor: Sanpi <sanpi+aur@homecomputing.fr>

pkgname=grcov
pkgver=0.8.18
pkgrel=1
pkgdesc="Rust tool to collect and aggregate code coverage data for multiple source files"
arch=('loong64' 'x86_64')
url="https://github.com/mozilla/grcov"
license=('MPL2')
depends=('zlib' 'gcc-libs')
makedepends=('cargo')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('353a9b30a5b0fdf50b4c488387cf40fa8b9cf078c4ec00513ad056a9729e4014')

prepare() {
  cd "$pkgname-$pkgver"
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
  cd "$pkgname-$pkgver"
  cargo build --release --frozen
}

check() {
  cd "$pkgname-$pkgver"
  cargo test --frozen --lib
}

package() {
  cd "$pkgname-$pkgver"
  install -Dm 755 "target/release/$pkgname" -t "$pkgdir/usr/bin"
  install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
}

# vim: ts=2 sw=2 et:
